let audioply = new Audio();
audioply.playAudio = function(url){
    console.log(this.vm);
    audioply.src = url;
	audioply.oncanplay = function(){
		console.log('canplay')
		audioply.play();
	}
    // this.vm.$store.commit("test")
}
// 监听音频状态 播放/暂停状态
audioply.addEventListener("play",function(){
	// console.log("播放中")
	this.vm.$store.commit("changePlayerState","playing")
})
audioply.addEventListener("pause",function(){
	// console.log("暂停中")
	this.vm.$store.commit("changePlayerState","pause")
})
audioply.addEventListener("timeupdate",function(){
	// console.log("持续播放中")
	// this.vm.$store.commit("","")
	let currentTime = audioply.currentTime;
	let currentDuration = audioply.duration
	// console.log(currentTime)
	this.vm.$store.commit("getCurrentTime",{
		curTime:currentTime,
		curDuration:currentDuration
	})
})

export default audioply;